# Methods added to this helper will be available to all templates in the application.
module ApplicationHelper

  # get select from collection
  def select_from_collection(obj, field, collection)
    options = collection.collect {|p| [p.name, p.id]}
    options.unshift( ["Please Select", ""] )  # passing {:prompt => true}
    select obj, field, options
  end
  
  # get select from array
  def select_from_array(obj, field, collection, params={})
    options = collection
    options.unshift( ["Please Select", ""] )  # passing {:prompt => true}
    select obj, field, options, params
  end
end
